﻿using System;
using System.IO;
using System.Text;
using ProjScan.Tools;
using UnityEditor;
using UnityEditor.Animations;
using UnityEngine;

namespace ProjScan.RecordManager.AssetData
{
	// Token: 0x02000293 RID: 659
	internal class AnimatorControllerAssetData : UnityCreatableAssetData<RuntimeAnimatorController>
	{
		// Token: 0x0600114A RID: 4426 RVA: 0x00051AF4 File Offset: 0x0004FCF4
		public AnimatorControllerAssetData(int assetID, string assetPath, RuntimeAnimatorController animatorController)
		{
			this.asset = animatorController;
			this.assetName = Path.GetFileName(assetPath);
			this.assetDirectoryID = assetID;
			this.clipCount = 0;
			this.assetPath = AssetDatabase.GetAssetPath(this.asset);
			AnimatorControllerLayer[] layers = (animatorController as AnimatorController).layers;
			for (int i = 0; i < layers.Length; i++)
			{
				ChildAnimatorState[] states = layers[i].stateMachine.states;
				this.clipCount += states.Length;
			}
		}

		// Token: 0x0600114B RID: 4427 RVA: 0x00051B7C File Offset: 0x0004FD7C
		public override string GetCSVHeader()
		{
			return "Name,DirID,ClipCount";
		}

		// Token: 0x0600114C RID: 4428 RVA: 0x00051B94 File Offset: 0x0004FD94
		public override string GetInfo()
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(ToolsHelper.QuoteString(this.assetName));
			stringBuilder.Append(',');
			stringBuilder.Append(this.assetDirectoryID);
			stringBuilder.Append(',');
			stringBuilder.Append(this.clipCount);
			return stringBuilder.ToString();
		}

		// Token: 0x0600114D RID: 4429 RVA: 0x00051BF0 File Offset: 0x0004FDF0
		public override string GetAssetPath()
		{
			return this.assetPath;
		}

		// Token: 0x0600114E RID: 4430 RVA: 0x00051BF0 File Offset: 0x0004FDF0
		public override string GetFileAssetPath()
		{
			return this.assetPath;
		}

		// Token: 0x04000A07 RID: 2567
		public int clipCount;

		// Token: 0x04000A08 RID: 2568
		private string assetPath;
	}
}
